<div class="blazorise-codeblock">
<div class="csharp"><pre>
<span class="keyword">public</span> <span class="keyword">sealed</span> <span class="keyword">class</span> MockNavigationManager
    : NavigationManager
{
    <span class="keyword">public</span> MockNavigationManager() : <span class="keyword">base</span>() =&gt; 
        <span class="keyword">this</span>.Initialize(<span class="string">&quot;http://localhost/&quot;</span>, <span class="string">&quot;http://localhost/test&quot;</span>);

    <span class="keyword">protected</span> <span class="keyword">override</span> <span class="keyword">void</span> NavigateToCore(<span class="keyword">string</span> uri, <span class="keyword">bool</span> forceLoad) 
        =&gt; WasNavigateInvoked = <span class="keyword">true</span>;

    <span class="keyword">public</span> <span class="keyword">bool</span> WasNavigateInvoked { <span class="keyword">get</span>; <span class="keyword">private</span> <span class="keyword">set</span>; }
}
</pre></div>
</div>
